package com.snk.back.controller;

import com.snk.back.service.SysLogService;
import com.snk.common.pojo.JsonResult;
import com.snk.common.pojo.PageObject;
import com.snk.pojo.SysLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/log/")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;


    @RequestMapping("doFindPageObjects")
    @ResponseBody
    public JsonResult doFindPageObjects(String username, Long pageCurrent){
        PageObject<SysLog> pageObject=
                sysLogService.findPageObjects(username, pageCurrent);

        return new JsonResult(pageObject);
    }


    @RequestMapping("doDeleteObjects")
    @ResponseBody
    public JsonResult doDeleteObjects(Integer ...ids){
        sysLogService.deleteObjects(ids);
        return new JsonResult("delete OK");
    }
}
